package com.bpc.cs.dao;

import java.util.List;

import com.bpc.cs.dto.FactorChoiceDTO;
import com.bpc.cs.dto.RuleDTO;

/**
 * @author   phan_tp
 * @datetime Nov 30, 2012 : 4:50:15 PM
 */
public interface IRuleDAO {

	/**
	 * Select list factorChoice of ruleID
	 * @param int ruleID
	 * @return List<FactorChoiceDTO>
	 */
	public List<FactorChoiceDTO> selectFactorChoiceByRuleID(int ruleID);

	/**
	 * Insert new rule
	 * @param RuleDTO ruleDTO
	 * @return boolean TRUE : Insert successfully
	 * 				   FALSE: Insert failed
	 */
	public boolean insertRule(RuleDTO ruleDTO);

	/**
	 * Update rule
	 * @param RuleDTO ruleDTO
	 * @return boolean TRUE : Update successfully
	 * 				   FALSE: Update failed
	 */
	public boolean updateRule(RuleDTO ruleDTO);

	/**
	 * Delete rule from SCORING_RULE table
	 * @param int ruleID
	 * @return boolean TRUE : delete successfully
	 * 				   FALSE: delete failed
	 */
	public boolean deleteRule(int ruleID);

	/**
	 * Delete entire rule and factor choice
	 * @param int ruleID
	 * @return boolean TRUE : Delete successfully
	 * 				   FALSE: Delete failed
	 */
	public boolean deleteEntireRule(int ruleID);

	/**
	 * Check factorName is duplicated or not
	 * @param int schemeID
	 * @param int factorID
	 * @return boolean TRUE : FactorName is duplicated
	 * 				   FALSE: FactorName isn't duplicated
	 */
	public boolean isDuplicatedFactorName(final int schemeID, final int factorID);
}
